//
//  BaseViewController.m
//  WanCiWang
//
//  Created by rimi on 2016/11/28.
//  Copyright © 2016年 dongfumei. All rights reserved.
//

#import "BaseViewController.h"
#import "Adaption.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.view addSubview:self.navigationBars];
    
}

-(void)backButtonClick{
    // 返回
    [(UINavigationController *)([UIApplication sharedApplication].keyWindow.rootViewController) dismissViewControllerAnimated:NO completion:nil];
}


-(NaviGationBarView *)navigationBars{
    if (!_navigationBars) {
        _navigationBars = [[NaviGationBarView alloc]initWithFrame:AAdaptionRect(0, 0, kBaseWidth/AAdaptationWidth(), 64/AAdaptationWidth())];
        self.navigationBars.backgroundColor = [UIColor brownColor];
        [_navigationBars.backButton addTarget:self action:@selector(backButtonClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _navigationBars;
}

@end
